﻿@model IEnumerable< AmazeUI.bll.GetModel.XtNav2>
@{
    var routeData = ViewContext.RouteData.Route.GetRouteData(this.Context);
}
<div class="admin-sidebar am-offcanvas" id="admin-offcanvas">
    <div class="am-offcanvas-bar admin-offcanvas-bar">
        <ul class="am-list admin-sidebar-list">
            @foreach (var item in Model)
            {
                if (item.XtNav2S == null)
                {
                    <li><a href="@Url.Action(item.Action ,item.Controllers)"><span class="@item.Ioc"></span> @item.Name</a></li>
                }
                else
                {
                    <li class="am-parent">
                        <a class="am-cf" data-am-collapse="{target: '#collapse-nav@(item.Name)'}"><span class="@item.Ioc"></span>@item.Name <span class="am-icon-angle-right am-fr am-margin-right"></span></a>
                        <ul class="am-list am-collapse admin-sidebar-sub am-in" id="collapse-nav@(item.Name)">
                            @foreach (var item2 in item.XtNav2S)
                            {

                                <li><a href="@Url.Action(item2.Action ,item2.Controllers)" class="@(routeData != null && item2.Action == routeData.Values["action"].ToString().ToLower() && item2.Controllers == routeData.Values["controller"].ToString().ToLower() ? "am-active" : "")"><span class="@item2.Ioc"></span> @item2.Name </a></li>
                            }

                        </ul>
                    </li>
                }
            }
        </ul>
        <div class="am-panel am-panel-default admin-sidebar-panel">
            <div class="am-panel-bd">
                <p><span class="am-icon-bookmark"></span> 公告</p>
                <p>时光静好，与君语；细水流年，与君同。—— Amaze UI</p>
            </div>
        </div>
        <div class="am-panel am-panel-default admin-sidebar-panel">
            <div class="am-panel-bd">
                <p><span class="am-icon-tag"></span> wiki</p>
                <p>Welcome to the Amaze UI wiki!</p>
            </div>
        </div>
    </div>
</div>